var ADMIN_API = "/api/admin";
var API = "/api/";
var PLAYER_API = API + "Player.php";

var players = new Array();


function MakeRequest(url, pars, success, error)
{
  $.ajax({
  type: 'POST',
  url: url,
  data : pars,
  dataType: 'json',
  success: function(data)
  {
    var code = data.code;
    var message = data.message;
    switch(code)
    {
      case 200:
        if (typeof success == "function")
          success(message);
        break;
      default:
        if (typeof error == "function")
          error(message, code);
        else
          ShowError(message);
        break;
    }
  }
  });
}

function GetPlayerDeck(gameId, playerId)
{
  var pars = {
    gameId: gameId,
    playerId: playerId,
    action: 'get'
  };
  
  MakeRequest(
      PLAYER_API,
      pars,
      function(response)
      {
        console.info(response);
      }
    );
    return false;
}